(require 'autoinsert)

(auto-insert-mode)

(add-hook 'find-file-hook 'auto-insert)
(add-hook 'before-save-hook 'copyright-update)

(setq auto-insert-directory "~/.emacs.d/auto-insert-templates/") ;;; Or use custom, *NOTE* Trailing slash important
(setq auto-insert-query nil) ;;; If you don't want to be prompted before insertion
; (define-auto-insert "\.php$" "my-php-template.php")

(or (assoc "\\.\\(module\\|inc\\|php\\|install\\)$" auto-insert-alist)
    (define-auto-insert "\\.\\(module\\|inc\\|php\\|install\\)$"
      (lambda ()
        (insert "<?php\n\n")
        (doxymacs-insert-file-comment))))

(or (assoc "\\.js$" auto-insert-alist) (define-auto-insert "\\.js$" 'doxymacs-insert-file-comment))
